/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - BuscaRapidaVO.as.
 */

package valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.EventDispatcher;
import mx.collections.ArrayCollection;
import mx.events.PropertyChangeEvent;
import valueObjects.UsuarioVO;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_BuscaRapidaVO extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
        try
        {
            if (flash.net.getClassByAlias("com.event.management.vo.BuscaRapidaVO") == null)
            {
                flash.net.registerClassAlias("com.event.management.vo.BuscaRapidaVO", cz);
            }
        }
        catch (e:Error)
        {
            flash.net.registerClassAlias("com.event.management.vo.BuscaRapidaVO", cz);
        }
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
        valueObjects.UsuarioVO.initRemoteClassAliasSingleChild();
        valueObjects.PerfilUsuarioVO.initRemoteClassAliasSingleChild();
        valueObjects.MenuSistemaVO.initRemoteClassAliasSingleChild();
        valueObjects.ItemMenuSistemaVO.initRemoteClassAliasSingleChild();
        valueObjects.PermissaoUsuarioVO.initRemoteClassAliasSingleChild();
        valueObjects.OperacaoVO.initRemoteClassAliasSingleChild();
        valueObjects.AreaUsuarioVO.initRemoteClassAliasSingleChild();
    }

    model_internal var _dminternal_model : _BuscaRapidaVOEntityMetadata;
    model_internal var _changedObjects:mx.collections.ArrayCollection = new ArrayCollection();

    public function getChangedObjects() : Array
    {
        _changedObjects.addItemAt(this,0);
        return _changedObjects.source;
    }

    public function clearChangedObjects() : void
    {
        _changedObjects.removeAll();
    }

    /**
     * properties
     */
    private var _internal_total : Number;
    private var _internal_percentual : Number;
    private var _internal_urlImagem : String;
    private var _internal_totalRegistros : int;
    private var _internal_maximo : Number;
    private var _internal_quantidade : Number;
    private var _internal_mes : Number;
    private var _internal_periodoFinal : Date;
    private var _internal_codigoEntidade : String;
    private var _internal_ano : Number;
    private var _internal_dataCadastro : Date;
    private var _internal_descricaoEntidade : String;
    private var _internal_nomeEntidade : String;
    private var _internal_valorParcial : Number;
    private var _internal_dataUltimaAlteracao : Date;
    private var _internal_tipoEntidade : String;
    private var _internal_dia : Number;
    private var _internal_parcial : Number;
    private var _internal_minimo : Number;
    private var _internal_usuarioUltimaAlteracao : valueObjects.UsuarioVO;
    private var _internal_periodoInicial : Date;
    private var _internal_valorTotal : Number;
    private var _internal_numRegPaginas : int;
    private var _internal_indicePagina : int;
    private var _internal_usuarioCadastro : valueObjects.UsuarioVO;
    private var _internal_selecionado : Boolean;

    private static var emptyArray:Array = new Array();

    // Change this value according to your application's floating-point precision
    private static var epsilon:Number = 0.0001;

    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_BuscaRapidaVO()
    {
        _model = new _BuscaRapidaVOEntityMetadata(this);

        // Bind to own data or source properties for cache invalidation triggering

    }

    /**
     * data/source property getters
     */

    [Bindable(event="propertyChange")]
    public function get total() : Number
    {
        return _internal_total;
    }

    [Bindable(event="propertyChange")]
    public function get percentual() : Number
    {
        return _internal_percentual;
    }

    [Bindable(event="propertyChange")]
    public function get urlImagem() : String
    {
        return _internal_urlImagem;
    }

    [Bindable(event="propertyChange")]
    public function get totalRegistros() : int
    {
        return _internal_totalRegistros;
    }

    [Bindable(event="propertyChange")]
    public function get maximo() : Number
    {
        return _internal_maximo;
    }

    [Bindable(event="propertyChange")]
    public function get quantidade() : Number
    {
        return _internal_quantidade;
    }

    [Bindable(event="propertyChange")]
    public function get mes() : Number
    {
        return _internal_mes;
    }

    [Bindable(event="propertyChange")]
    public function get periodoFinal() : Date
    {
        return _internal_periodoFinal;
    }

    [Bindable(event="propertyChange")]
    public function get codigoEntidade() : String
    {
        return _internal_codigoEntidade;
    }

    [Bindable(event="propertyChange")]
    public function get ano() : Number
    {
        return _internal_ano;
    }

    [Bindable(event="propertyChange")]
    public function get dataCadastro() : Date
    {
        return _internal_dataCadastro;
    }

    [Bindable(event="propertyChange")]
    public function get descricaoEntidade() : String
    {
        return _internal_descricaoEntidade;
    }

    [Bindable(event="propertyChange")]
    public function get nomeEntidade() : String
    {
        return _internal_nomeEntidade;
    }

    [Bindable(event="propertyChange")]
    public function get valorParcial() : Number
    {
        return _internal_valorParcial;
    }

    [Bindable(event="propertyChange")]
    public function get dataUltimaAlteracao() : Date
    {
        return _internal_dataUltimaAlteracao;
    }

    [Bindable(event="propertyChange")]
    public function get tipoEntidade() : String
    {
        return _internal_tipoEntidade;
    }

    [Bindable(event="propertyChange")]
    public function get dia() : Number
    {
        return _internal_dia;
    }

    [Bindable(event="propertyChange")]
    public function get parcial() : Number
    {
        return _internal_parcial;
    }

    [Bindable(event="propertyChange")]
    public function get minimo() : Number
    {
        return _internal_minimo;
    }

    [Bindable(event="propertyChange")]
    public function get usuarioUltimaAlteracao() : valueObjects.UsuarioVO
    {
        return _internal_usuarioUltimaAlteracao;
    }

    [Bindable(event="propertyChange")]
    public function get periodoInicial() : Date
    {
        return _internal_periodoInicial;
    }

    [Bindable(event="propertyChange")]
    public function get valorTotal() : Number
    {
        return _internal_valorTotal;
    }

    [Bindable(event="propertyChange")]
    public function get numRegPaginas() : int
    {
        return _internal_numRegPaginas;
    }

    [Bindable(event="propertyChange")]
    public function get indicePagina() : int
    {
        return _internal_indicePagina;
    }

    [Bindable(event="propertyChange")]
    public function get usuarioCadastro() : valueObjects.UsuarioVO
    {
        return _internal_usuarioCadastro;
    }

    [Bindable(event="propertyChange")]
    public function get selecionado() : Boolean
    {
        return _internal_selecionado;
    }

    public function clearAssociations() : void
    {
    }

    /**
     * data/source property setters
     */

    public function set total(value:Number) : void
    {
        var oldValue:Number = _internal_total;
        if (oldValue !== value)
        {
            _internal_total = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "total", oldValue, _internal_total));
        }
    }

    public function set percentual(value:Number) : void
    {
        var oldValue:Number = _internal_percentual;
        if (isNaN(_internal_percentual) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_percentual = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "percentual", oldValue, _internal_percentual));
        }
    }

    public function set urlImagem(value:String) : void
    {
        var oldValue:String = _internal_urlImagem;
        if (oldValue !== value)
        {
            _internal_urlImagem = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "urlImagem", oldValue, _internal_urlImagem));
        }
    }

    public function set totalRegistros(value:int) : void
    {
        var oldValue:int = _internal_totalRegistros;
        if (oldValue !== value)
        {
            _internal_totalRegistros = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "totalRegistros", oldValue, _internal_totalRegistros));
        }
    }

    public function set maximo(value:Number) : void
    {
        var oldValue:Number = _internal_maximo;
        if (oldValue !== value)
        {
            _internal_maximo = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "maximo", oldValue, _internal_maximo));
        }
    }

    public function set quantidade(value:Number) : void
    {
        var oldValue:Number = _internal_quantidade;
        if (oldValue !== value)
        {
            _internal_quantidade = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "quantidade", oldValue, _internal_quantidade));
        }
    }

    public function set mes(value:Number) : void
    {
        var oldValue:Number = _internal_mes;
        if (oldValue !== value)
        {
            _internal_mes = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "mes", oldValue, _internal_mes));
        }
    }

    public function set periodoFinal(value:Date) : void
    {
        var oldValue:Date = _internal_periodoFinal;
        if (oldValue !== value)
        {
            _internal_periodoFinal = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "periodoFinal", oldValue, _internal_periodoFinal));
        }
    }

    public function set codigoEntidade(value:String) : void
    {
        var oldValue:String = _internal_codigoEntidade;
        if (oldValue !== value)
        {
            _internal_codigoEntidade = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "codigoEntidade", oldValue, _internal_codigoEntidade));
        }
    }

    public function set ano(value:Number) : void
    {
        var oldValue:Number = _internal_ano;
        if (oldValue !== value)
        {
            _internal_ano = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "ano", oldValue, _internal_ano));
        }
    }

    public function set dataCadastro(value:Date) : void
    {
        var oldValue:Date = _internal_dataCadastro;
        if (oldValue !== value)
        {
            _internal_dataCadastro = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "dataCadastro", oldValue, _internal_dataCadastro));
        }
    }

    public function set descricaoEntidade(value:String) : void
    {
        var oldValue:String = _internal_descricaoEntidade;
        if (oldValue !== value)
        {
            _internal_descricaoEntidade = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "descricaoEntidade", oldValue, _internal_descricaoEntidade));
        }
    }

    public function set nomeEntidade(value:String) : void
    {
        var oldValue:String = _internal_nomeEntidade;
        if (oldValue !== value)
        {
            _internal_nomeEntidade = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "nomeEntidade", oldValue, _internal_nomeEntidade));
        }
    }

    public function set valorParcial(value:Number) : void
    {
        var oldValue:Number = _internal_valorParcial;
        if (isNaN(_internal_valorParcial) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_valorParcial = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "valorParcial", oldValue, _internal_valorParcial));
        }
    }

    public function set dataUltimaAlteracao(value:Date) : void
    {
        var oldValue:Date = _internal_dataUltimaAlteracao;
        if (oldValue !== value)
        {
            _internal_dataUltimaAlteracao = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "dataUltimaAlteracao", oldValue, _internal_dataUltimaAlteracao));
        }
    }

    public function set tipoEntidade(value:String) : void
    {
        var oldValue:String = _internal_tipoEntidade;
        if (oldValue !== value)
        {
            _internal_tipoEntidade = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "tipoEntidade", oldValue, _internal_tipoEntidade));
        }
    }

    public function set dia(value:Number) : void
    {
        var oldValue:Number = _internal_dia;
        if (oldValue !== value)
        {
            _internal_dia = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "dia", oldValue, _internal_dia));
        }
    }

    public function set parcial(value:Number) : void
    {
        var oldValue:Number = _internal_parcial;
        if (oldValue !== value)
        {
            _internal_parcial = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "parcial", oldValue, _internal_parcial));
        }
    }

    public function set minimo(value:Number) : void
    {
        var oldValue:Number = _internal_minimo;
        if (oldValue !== value)
        {
            _internal_minimo = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "minimo", oldValue, _internal_minimo));
        }
    }

    public function set usuarioUltimaAlteracao(value:valueObjects.UsuarioVO) : void
    {
        var oldValue:valueObjects.UsuarioVO = _internal_usuarioUltimaAlteracao;
        if (oldValue !== value)
        {
            _internal_usuarioUltimaAlteracao = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "usuarioUltimaAlteracao", oldValue, _internal_usuarioUltimaAlteracao));
        }
    }

    public function set periodoInicial(value:Date) : void
    {
        var oldValue:Date = _internal_periodoInicial;
        if (oldValue !== value)
        {
            _internal_periodoInicial = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "periodoInicial", oldValue, _internal_periodoInicial));
        }
    }

    public function set valorTotal(value:Number) : void
    {
        var oldValue:Number = _internal_valorTotal;
        if (isNaN(_internal_valorTotal) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_valorTotal = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "valorTotal", oldValue, _internal_valorTotal));
        }
    }

    public function set numRegPaginas(value:int) : void
    {
        var oldValue:int = _internal_numRegPaginas;
        if (oldValue !== value)
        {
            _internal_numRegPaginas = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "numRegPaginas", oldValue, _internal_numRegPaginas));
        }
    }

    public function set indicePagina(value:int) : void
    {
        var oldValue:int = _internal_indicePagina;
        if (oldValue !== value)
        {
            _internal_indicePagina = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "indicePagina", oldValue, _internal_indicePagina));
        }
    }

    public function set usuarioCadastro(value:valueObjects.UsuarioVO) : void
    {
        var oldValue:valueObjects.UsuarioVO = _internal_usuarioCadastro;
        if (oldValue !== value)
        {
            _internal_usuarioCadastro = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "usuarioCadastro", oldValue, _internal_usuarioCadastro));
        }
    }

    public function set selecionado(value:Boolean) : void
    {
        var oldValue:Boolean = _internal_selecionado;
        if (oldValue !== value)
        {
            _internal_selecionado = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "selecionado", oldValue, _internal_selecionado));
        }
    }

    /**
     * Data/source property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _BuscaRapidaVOEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _BuscaRapidaVOEntityMetadata) : void
    {
        var oldValue : _BuscaRapidaVOEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }


}

}
